package Day19;



import java.util.Arrays;
import java.util.Random;

/**
 * @author hyhWTX
 * @version 1.0
 * @date 2022年03月19日 15:58
 */

/*随机数排序*/
public class MaoPao {
    public static void main(String[] args) {
        int []array = new int[10];
        for (int i = 0; i <array.length ; i++) {
            Random random = new Random();
            array[i] = random.nextInt(20);

        }
        for (int i = 0; i <array.length-1 ; i++) {
            for (int j = 0; j <array.length-1 ; j++) {
                if (array[j]>array[j+1]){
                    int n = array[j];
                    array[j] = array[j+1];
                    array[j+1] = n;
                }
            }
        }
        System.out.println(Arrays.toString(array));
    }
}
